package day04;

import java.util.Scanner;

public class HomeWork1 {
    public static void main(String[] args) {
        /*
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择功能:1.存款 2.取款 3.查看余额 4.退卡");
        int command = scanner.nextInt();
        switch (command){
            case 1:
                System.out.println("请存钱");
                break;
            case 2:
                System.out.println("请取走钱");
                break;
            case 3:
                System.out.println("余额为:...");
                break;
            case 4:
                System.out.println("请取走卡片");
                break;
            default:
                System.out.println("输入错误,请重新输入...");
        }

         */
        Scanner scanner = new Scanner(System.in);
        System.out.println("我们来猜数字,请输入一个数:");
        int number = (int)(Math.random()*1000+1);
        int guess = scanner.nextInt();
        while (guess != number){
            if (guess < number){
                System.out.println("猜小了,再猜吧..");
            }
            else {
                System.out.println("猜大了,再猜猜吧..");
            }
                guess = scanner.nextInt();
            }
            System.out.println("猜对了");
        }

    }

